<%@ page import="cn.cdut.servlet.tools.JDBC.Sign" %><%--
  Created by IntelliJ IDEA.
  User: 王勇
  Date: 2023/4/14
  Time: 9:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录界面</title>
    <link href="login.css" rel="stylesheet">
    <script>
        function checkInput(event) {
            const input = event.target;
            input.value = input.value.replace(/[\u4e00-\u9fa5]/g, "");
        }
    </script>
</head>
<body>
<%
    if (Sign.dflag != 0) {
        switch (Sign.dflag) {
            case 1:
                out.print("<script>alert('" + "用户名或密码错误" + "');</script>");
                break;
            case 2:
                out.print("<script>alert('" + "注册成功请登录" + "');</script>");
                break;
            case 3:
                out.print("<script>alert('" + "请先登录" + "');</script>");
                break;
        }
    }
    Sign.dflag = 0;
%>
<div class="header">
    <ul class="u-1">
        <li> <div class="loname">小王外卖</div></li>
        <li> <div class="logo"></div></li>
        <li><a href="#">Home</a></li>
        <li><a href="#">Contact us</a></li>
        <li><a href="#">Help</a></li>
    </ul>
    <ul class="u-2">
        <li><a href="login.jsp">Login</a></li>
        <li><a href="register.jsp">Register</a></li>
    </ul>
</div>
<div class="box1-f">
    <div class="box1">
        <form action="/demo1" method="post">
            <div style="margin: 0px auto;text-align:center;">
                <h4 style=" font-size: 50px; ">login</h4>
                <div style="position: relative;">
                    <div style=" font-size: 15px;margin-left: -207px;">E-mail</div>
                    <div class="email"></div>
                    <input type="text" id="email" name="email" oninput="checkInput(event)"
                           placeholder="Please enter your email" pattern="[a-zA-Z0-9@.]*" required maxlength="18">
                </div>
                <div>
                    <div style=" font-size: 15px; margin-top: 10px;margin-left: -184px;">Password</div>
                    <div class="psd"></div>
                    <input type="password" name="psd" placeholder="Please enter a password"
                           oninput="checkInput(event)" required maxlength="12"/>
                </div>
                <br><br>
                <div>
                    <input type="submit" name="submit" id="sub" value="go"
                           style="cursor: pointer; margin-left:36px; background-color: orange;font-size: 30px ;height: 50px;border: aliceblue"/>
                </div>
            </div>
            <div style=" font-size: 15px;margin-top: 10px; margin-left: -223px;">Other logins</div>
            <ul class="u-3" style="margin: 0 auto; display: flex;justify-content: space-around;width: 200px;">
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </form>
    </div>
</div>
</body>
</html>
